﻿
using MODEL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class suerdal
    {
        public suerdal(Hotect hotect)
        {
            Hotect = hotect;
        }

        public Hotect Hotect { get; }
        public int Add(suer suer)
        {
            Hotect.suers.Add(suer);
            return Hotect.SaveChanges();
        }
        public int Deng(string name,string pwd)
        {
            var hang = Hotect.suers.FirstOrDefault(x => x.Name == name);
            if (hang == null)
            {
                return -1;
            }
            else if(hang.pwss==pwd)
            {
                return 1;
            }
            return 0;
        }
    }
}
